<template>
  <div class="uploader-demo">
    <h3 class="title">单图片上传-file对象</h3>
    <div>
      <d-uploader type="image" dataType="file" :afterRead="afterRead"></d-uploader>
    </div>
    <h3 class="title">多图片上传-file对象</h3>
    <div>
      <d-uploader type="images" dataType="file" :afterRead="afterRead"></d-uploader>
    </div>
    <h3 class="title">单文件上传-file对象</h3>
    <div v-width="300">
      <d-uploader type="file" dataType="file" :afterRead="afterRead"></d-uploader>
    </div>
    <h3 class="title">多文件上传-file对象</h3>
    <div v-width="300">
      <d-uploader type="files" dataType="file" :afterRead="afterRead"></d-uploader>
    </div>
  </div>
</template>

<script>
export default {
  name: 'uploaderDemo',
  data () {
    return {}
  },
  methods: {
    afterRead (file) {
      // 此时可以自行将文件上传至服务器
      console.log(file)
    }
  }
}
</script>

<style lang="stylus" scoped>
// .uploader-demo
</style>
